﻿@model VendorAttributeSearchModel

<div class="card-body">
    <p>
        <em>@T("Admin.Vendors.VendorAttributes.Description")</em>
    </p>
    @await Html.PartialAsync("Table", new DataTablesModel
    {
        Name = "vendorattributes-grid",
        UrlRead = new DataUrl("List", "VendorAttribute", null),
        Length = Model.PageSize,
        LengthMenu = Model.AvailablePageSizes,
        ColumnCollection = new List<ColumnProperty>
        {
            new ColumnProperty(nameof(VendorAttributeModel.Name))
            {
                Title = T("Admin.Vendors.VendorAttributes.Fields.Name").Text,
                Width = "300"
            },
            new ColumnProperty(nameof(VendorAttributeModel.AttributeControlTypeName))
            {
                Title = T("Admin.Vendors.VendorAttributes.Fields.AttributeControlType").Text,
                Width = "200"
            },
            new ColumnProperty(nameof(VendorAttributeModel.IsRequired))
            {
                Title = T("Admin.Vendors.VendorAttributes.Fields.IsRequired").Text,
                Width = "100",
                ClassName =  NopColumnClassDefaults.CenterAll,
                Render = new RenderBoolean()
            },
            new ColumnProperty(nameof(VendorAttributeModel.DisplayOrder))
            {
                Title = T("Admin.Vendors.VendorAttributes.Fields.DisplayOrder").Text,
                Width = "100",
                ClassName = NopColumnClassDefaults.CenterAll
            },
            new ColumnProperty(nameof(VendorAttributeModel.Id))
            {
                Title = T("Admin.Common.Edit").Text,
                Width = "100",
                ClassName =  NopColumnClassDefaults.Button,
                Render = new RenderButtonEdit(new DataUrl("~/Admin/VendorAttribute/Edit/"))
            }
        }
    })
</div>
<div class="card-footer">
    <a class="btn btn-primary" href="@Url.Action("Create", "VendorAttribute")">
        <i class="fas fa-square-plus"></i>
        @T("Admin.Common.AddNew")
    </a>
</div>